package com.xiaochi.practice.api.enums;

import lombok.Getter;

/**
 * @author zqx
 * @since 2024/7/21
 * 删除枚举类
 */
@Getter
public enum IsDeletedEnum {

    DELETED_ENUM(1,"已删除"),
    UN_DELETED_ENUM(0,"未删除");


    private int code;
    private String message;

    IsDeletedEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public static IsDeletedEnum getResultCodeEnum(int code) {
        for (IsDeletedEnum resultCodeEnum : IsDeletedEnum.values()) {
            if (resultCodeEnum.getCode() == code) {
                return resultCodeEnum;
            }
        }
        return null;
    }
}
